#ifndef wchar_h
#define wchar_h

// header dependencies
#include "../arr.h"

// declare the wide char variables

// enum with supported encodings
typedef enum
{
  OWL_WCHAR_ENC_NO_ENC,
  OWL_WCHAR_ENC_ASCII,
  OWL_WCHAR_ENC_BIN,
  OWL_WCHAR_ENC_CP1252,
  OWL_WCHAR_ENC_SHIFT_JIS,
  OWL_WCHAR_ENC_UTF8,
  OWL_WCHAR_ENC_UTF16BE,
  OWL_WCHAR_ENC_UTF16LE,
  OWL_WCHAR_ENC_INVALID,
} owl_wchar_enc;

owl_char * OWL_WCHAR_ENC_STR[OWL_WCHAR_ENC_INVALID + 1] = {
  "ENC_NO_ENC",
  "ENC_ASCII",
  "ENC_BIN",
  "ENC_CP1252",
  "ENC_SHIFT_JIS",
  "ENC_UTF8",
  "ENC_UTF16BE",
  "ENC_UTF16LE",
  "ENC_INVALID",
};

// just a big enough unsigned integer
// depending on the enconding, the integer 
// will represent a different character
typedef owl_umax owl_wchar;

typedef enum
{
  OWL_TYPE_WCHAR_ENC = OWL_TYPE_ARR + 1,
  OWL_TYPE_WCHAR,
} owl_type_wchar_h;

// numeric constants positions 
#define OWL_WCHAR_NUM_0 0
#define OWL_WCHAR_NUM_1 1
#define OWL_WCHAR_NUM_2 2
#define OWL_WCHAR_NUM_3 3
#define OWL_WCHAR_NUM_4 4
#define OWL_WCHAR_NUM_5 5
#define OWL_WCHAR_NUM_6 6
#define OWL_WCHAR_NUM_7 7
#define OWL_WCHAR_NUM_8 8
#define OWL_WCHAR_NUM_9 9
#define OWL_WCHAR_NUM_A_UP 10
#define OWL_WCHAR_NUM_B_UP 11
#define OWL_WCHAR_NUM_C_UP 12
#define OWL_WCHAR_NUM_D_UP 13
#define OWL_WCHAR_NUM_E_UP 14
#define OWL_WCHAR_NUM_F_UP 15
#define OWL_WCHAR_NUM_A_LOW 16
#define OWL_WCHAR_NUM_B_LOW 17
#define OWL_WCHAR_NUM_C_LOW 18
#define OWL_WCHAR_NUM_D_LOW 19
#define OWL_WCHAR_NUM_E_LOW 20
#define OWL_WCHAR_NUM_F_LOW 21
#define OWL_WCHAR_NUM_PLUS 22
#define OWL_WCHAR_NUM_MINUS 23
#define OWL_WCHAR_NUM_DOT 24
#define OWL_WCHAR_NUM_X_UP 25
#define OWL_WCHAR_NUM_X_LOW 26
#define OWL_WCHAR_NUM_LENGTH 27

// whitespace constants positions
#define OWL_WCHAR_WSP_HTAB 0  // horizontal tab
#define OWL_WCHAR_WSP_LFEED 1 // line feed (newline)
#define OWL_WCHAR_WSP_VTAB 2  // vertical tab
#define OWL_WCHAR_WSP_FFEED 3 // form feed
#define OWL_WCHAR_WSP_CR 4    // carriage return
#define OWL_WCHAR_WSP_SP 5    // space
#define OWL_WCHAR_WSP_LENGTH 6

// path constants positions
#define OWL_WCHAR_PATH_FILE_EXT 2 // dot
#define OWL_WCHAR_PATH_DIV_LIN 0 // slash
#define OWL_WCHAR_PATH_DIV_WIN 1 // backslash
#define OWL_WCHAR_PATH_MOD_LIN 2 // dot
#define OWL_WCHAR_PATH_MOD_WIN 2 // dot
#define OWL_WCHAR_PATH_LENGTH 3

// letter constants positions
#define OWL_WCHAR_LETR_A_UP 0
#define OWL_WCHAR_LETR_B_UP 1
#define OWL_WCHAR_LETR_C_UP 2
#define OWL_WCHAR_LETR_D_UP 3
#define OWL_WCHAR_LETR_E_UP 4
#define OWL_WCHAR_LETR_F_UP 5
#define OWL_WCHAR_LETR_G_UP 6
#define OWL_WCHAR_LETR_H_UP 7
#define OWL_WCHAR_LETR_I_UP 8
#define OWL_WCHAR_LETR_J_UP 9
#define OWL_WCHAR_LETR_K_UP 10
#define OWL_WCHAR_LETR_L_UP 11
#define OWL_WCHAR_LETR_M_UP 12
#define OWL_WCHAR_LETR_N_UP 13
#define OWL_WCHAR_LETR_O_UP 14
#define OWL_WCHAR_LETR_P_UP 15
#define OWL_WCHAR_LETR_Q_UP 16
#define OWL_WCHAR_LETR_R_UP 17
#define OWL_WCHAR_LETR_S_UP 18
#define OWL_WCHAR_LETR_T_UP 19
#define OWL_WCHAR_LETR_U_UP 20
#define OWL_WCHAR_LETR_V_UP 21
#define OWL_WCHAR_LETR_W_UP 22
#define OWL_WCHAR_LETR_X_UP 23
#define OWL_WCHAR_LETR_Y_UP 24
#define OWL_WCHAR_LETR_Z_UP 25
#define OWL_WCHAR_LETR_A_LOW 26
#define OWL_WCHAR_LETR_B_LOW 27
#define OWL_WCHAR_LETR_C_LOW 28
#define OWL_WCHAR_LETR_D_LOW 29
#define OWL_WCHAR_LETR_E_LOW 30
#define OWL_WCHAR_LETR_F_LOW 31
#define OWL_WCHAR_LETR_G_LOW 32
#define OWL_WCHAR_LETR_H_LOW 33
#define OWL_WCHAR_LETR_I_LOW 34
#define OWL_WCHAR_LETR_J_LOW 35
#define OWL_WCHAR_LETR_K_LOW 36
#define OWL_WCHAR_LETR_L_LOW 37
#define OWL_WCHAR_LETR_M_LOW 38
#define OWL_WCHAR_LETR_N_LOW 39
#define OWL_WCHAR_LETR_O_LOW 40
#define OWL_WCHAR_LETR_P_LOW 41
#define OWL_WCHAR_LETR_Q_LOW 42
#define OWL_WCHAR_LETR_R_LOW 43
#define OWL_WCHAR_LETR_S_LOW 44
#define OWL_WCHAR_LETR_T_LOW 45
#define OWL_WCHAR_LETR_U_LOW 46
#define OWL_WCHAR_LETR_V_LOW 47
#define OWL_WCHAR_LETR_W_LOW 48
#define OWL_WCHAR_LETR_X_LOW 49
#define OWL_WCHAR_LETR_Y_LOW 50
#define OWL_WCHAR_LETR_Z_LOW 51
#define OWL_WCHAR_LETR_LENGTH 52

// functions, as the new variable type is just 
// owl_umax, it inherits the owl_umax type functions
owl_bool owl_check_wchar_enc(owl_wchar_enc enc);

// basic functions
owl_umax (* owl_print_wchar)(owl_byte * mem, owl_umax mem_size) = owl_print_umax_hex;
owl_char (* owl_comp_wchar)(owl_byte * wchar1, owl_byte * wchar2) = owl_comp_umax;

#include "wchar.c"

#endif // wchar_h
